package com.chengyu.core.controller.shop;

import cn.hutool.core.bean.BeanUtil;
import com.chengyu.core.controller.UserBaseController;
import com.chengyu.core.domain.CommonConstant;
import com.chengyu.core.domain.enums.TrendsEnums;
import com.chengyu.core.domain.form.TrendsForm;
import com.chengyu.core.domain.result.WalkTrendsResult;
import com.chengyu.core.entity.CommonPage;
import com.chengyu.core.entity.CommonResult;
import com.chengyu.core.exception.ServiceException;
import com.chengyu.core.model.UmsShop;
import com.chengyu.core.model.UmsShopLevelPrice;
import com.chengyu.core.model.UmsShopOwnLevel;
import com.chengyu.core.service.member.MemberCollectShopService;
import com.chengyu.core.service.shop.ShopConfigService;
import com.chengyu.core.service.shop.ShopLevelService;
import com.chengyu.core.service.shop.ShopService;
import com.chengyu.core.service.walk.WalkMemberService;
import com.chengyu.core.service.walk.WalkTrendsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Api(tags = "会员等级")
@Controller
@RequestMapping("/common")
public class ShopLevelController extends UserBaseController {

	@Autowired
	private ShopLevelService shopLevelService;



	@ApiOperation(value = "根据店铺等级价格表id查看")
	@ResponseBody
	@RequestMapping(value="/shopLevelPrice/getShopLevelPriceById", method=RequestMethod.GET)
	public CommonResult<Map> getShopLevelPriceById(Integer levelPriceId) throws ServiceException {
		Map umsShopLevelPriceMap = shopLevelService.getShopLevelPriceById(levelPriceId);
		return CommonResult.success(umsShopLevelPriceMap);
	}

	@ApiOperation(value = "添加店铺等级拥有的等级（支付成功了）")
	@ResponseBody
	@RequestMapping(value="/shopLevelPrice/addShopOwnLevel", method=RequestMethod.GET)
	public CommonResult<String> addShopOwnLevel(UmsShopOwnLevel umsShopOwnLevel) throws ServiceException {
		shopLevelService.addShopOwnLevel(umsShopOwnLevel);
		return CommonResult.success(null);
	}

}